$(function() {

	// 获取服务器IP地址
	var pathname = window.location.pathname;

	var xnljs = pathname.split("/");

	// 获取配置文件IP地址及端口、获取00级单位名称
	var printIp = $("#printIp").val();
	var zeroDeptName = $("#zeroDeptName").val();
	/**
	 * 说明： type==1 G_MAIN,type==2 G_CHANGEMAIN 页面获取单据号
	 * $(this).attr("data-djh"));
	 */
	// 资产登记打印验收单
	/*
	 * 需要传入的参数： 1.单位名称 dwmc 2.单据号 danjuhao
	 */
	$("#astAddPrint").click(function() {
		var danjuNo = $("#txtBillNo").val();
		$.ajax({
			type : "post",
			url : "/swss/asset/search_findOneDanJuNoAstByExamply.action?type=1&danjuNo="
					+ danjuNo,
			dataType : "json",
			success : function(res) {
				if (res.count <= 5) {
					swss.ui
							.modal(
									"http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/zjd.htm&danjuhao="
											+ danjuNo + "&dwmc="
											+ escape(zeroDeptName)
											+ "&urlpara=yes", {
										title : "验收单",
										width : 1005,
										height : 600
									});
					return false;
				} else {

					swss.ui
							.modal(
									"http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/zjd_fmfd.htm&danjuhao="
											+ danjuNo + "&dwmc="
											+ escape(zeroDeptName)
											+ "&urlpara=yes", {
										title : "验收单",
										width : 1005,
										height : 600
									});
					return false;
				}
			},
			error : function() {
				alert("未知错误");
			}
		});
		return false;
	});
	// 设备增加单
	/*
	 * 需要传入的参数： 1.单位名称 dwmc 2.单据号 danjuhao
	 */
	$("a[id^='astAddPrint_']").click(function() {
		var danjuNo = $(this).attr("data-djh");
		// alert(zeroDeptName);
		$.ajax({
			type : "post",
			url : "/swss/asset/search_findOneDanJuNoAstByExamply.action?type=1&danjuNo="
					+ danjuNo,
			dataType : "json",
			success : function(res) {
				if (res.count <= 5) {
					swss.ui
							.modal(
									"http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/zjd.htm&danjuhao="
											+ danjuNo + "&dwmc="
											+ escape(zeroDeptName)
											+ "&urlpara=yes", {
										title : "验收单",
										width : 1500,
										height : 1000
									});
					return false;
				} else {
					swss.ui
							.modal(
									"http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/zjd_fmfd.htm&danjuhao="
											+ danjuNo + "&dwmc="
											+ escape(zeroDeptName)
											+ "&urlpara=yes", {
										title : "验收单",
										width : 1005,
										height : 600
									});
					return false;

				}
			},
			error : function() {
				alert("未知错误");
			}
		});
		return false;
	});
	// 设备处置申请单（厅本级）
	/*
	 * 调拨单需要传入的参数： 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 4.份数 fenshu=6
	 * 5.处置设备的数量 shul 报废申请单需要传入参数 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc
	 * 4.份数 fenshu=4 5.处置设备的数量 shul 6.传入连接：window.location.href="http://" +
	 * printIp + "/" + xnljs[1]+ "/ebsys/fceform/ereport/ebrun.htm?file=/" +
	 * xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&fenshu=4&urlpara=yes";
	 * 和window.location.href="http://" + printIp + "/" + xnljs[1]+
	 * "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&shul="+shul+"&urlpara=yes";
	 * 转入转出申请需要传入的参数 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 4.份数 fenshu=3
	 * 5.处置设备的数量 shul 6.传入连接：window.location.href="http://" + printIp + "/" +
	 * xnljs[1]+ "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&fenshu=3&urlpara=yes";
	 * 和window.location.href="http://" + printIp + "/" + xnljs[1]+
	 * "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&shul="+shul+"&urlpara=yes";
	 * 
	 */
	// 设备处置申请单（省级财政审批权限）
	/*
	 * 调拨单需要传入的参数： 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 4.份数 fenshu=6
	 * 5.处置设备的数量 shul 6.传入连接：window.location.href="http://" + printIp + "/" +
	 * xnljs[1]+ "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&fenshu=6&urlpara=yes";
	 * 和window.location.href="http://" + printIp + "/" + xnljs[1]+
	 * "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&shul="+shul+"&urlpara=yes";
	 * 报废申请单需要传入参数 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 4.份数 fenshu=4
	 * 5.处置设备的数量 shul 6.传入连接：window.location.href="http://" + printIp + "/" +
	 * xnljs[1]+ "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&fenshu=4&urlpara=yes";
	 * 和window.location.href="http://" + printIp + "/" + xnljs[1]+
	 * "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&shul="+shul+"&urlpara=yes";
	 * 转入转出申请需要传入的参数 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 4.份数 fenshu=3
	 * 5.处置设备的数量 shul 6.传入连接：window.location.href="http://" + printIp + "/" +
	 * xnljs[1]+ "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&fenshu=3&urlpara=yes";
	 * 和window.location.href="http://" + printIp + "/" + xnljs[1]+
	 * "/ebsys/fceform/ereport/ebrun.htm?file=/" + xnljs[1]+
	 * "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&tbdw="+escape("XX软件")+"&bddanjuhao="+
	 * danjuNo + "&dwmc="+escape("XX软件")+"&shul="+shul+"&urlpara=yes";
	 * 
	 */
	// 所有变动申请单都需要传的值
	/*
	 * 1.填报单位 tbdw 2.变动单据号 bddanjuhao 3.单位名称 dwmc 外部调出还需要：调入单位 drdw
	 */
	/**
	 * 设备处置申请单(提交时)
	 */
	$("#chageastPrint").click(function() {
		var bddanjuhao = $("#chageBillNo").val();
		var applyMethod = $("#applyMethod").val(); // 处置方式
		var tableType = $("#tableType").val(); // 审批单类型
		var urlMain = ""; // 申请单主页面链接URL
		var urlAppendix = ""; // 附件页面连接URL
		$.ajax({
			type : "post",
			url : "/swss/asset/search_findOneDanJuNoAstByExamply.action?type=2&bddanjuhao="
					+ bddanjuhao,
			dataType : "json",
			success : function(res) {
				switch (applyMethod) {
					case '1' : // 增减值处理
						urlMain += "http://"
								+ printIp
								+ "/"
								+ xnljs[1]
								+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
								+ xnljs[1]
								+ "/ebsys/ebfile/baobiao/sbgl/sbzjzzjd.htm&bddanjuhao="
								+ bddanjuhao + "&dwmc=" + escape(zeroDeptName)
								+ "&tbdw=" + escape(tbdw) + "&urlpara=yes";
						break;
					case '9' : // 单位内容转移
						if (res.count <= 11) {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/nbzczyd.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&dwmc="
									+ escape(zeroDeptName) + "&tbdw="
									+ escape(tbdw) + "&fenshu=3&urlpara=yes";
						} else {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/nbzczyd_fm.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&dwmc="
									+ escape(zeroDeptName) + "&tbdw="
									+ escape(tbdw) + "&fenshu=3&urlpara=yes";
							urlAppendix += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&dwmc="
									+ escape(zeroDeptName) + "&tbdw="
									+ escape(tbdw) + "&fenshu=3&urlpara=yes";

						}

						break;
					case '7' : // 无偿划拨 注：有偿转让[6]申请单与此一致，必要时可加处理
						if (tableType == '0') {
							if (res.count <= 14) {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/dbd.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/dbd_fm.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
							}
						} else {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&tbdw="
									+ escape(tbdw) + "&dwmc=" + escape(dwmc)
									+ "&bddanjuhao=" + bddanjuhao + "&&drdw="
									+ escape(drdw) + "shul=" + shul
									+ "&fenshu=6&urlpara=yes";
							urlAppendix += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&drdw="
									+ escape(drdw) + "&dwmc=" + escape(dwmc)
									+ "&tbdw=" + escape(tbdw)
									+ "&fenshu=6&urlpara=yes";
						}
						break;
					case '6' : // 无偿划拨 注：有偿转让[6]申请单与此一致，必要时可加处理
						if (tableType == '0') {
							if (res.count <= 14) {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/dbd.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/dbd_fm.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw)
										+ "&fenshu=6&urlpara=yes";
							}
						} else {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&tbdw="
									+ escape(tbdw) + "&dwmc=" + escape(dwmc)
									+ "&bddanjuhao=" + bddanjuhao + "&shul="
									+ shul + "&drdw=" + escape(drdw)
									+ "&fenshu=6&urlpara=yes";
							urlAppendix += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&drdw="
									+ escape(drdw) + "&dwmc=" + escape(dwmc)
									+ "&tbdw=" + escape(tbdw)
									+ "&fenshu=6&urlpara=yes";
						}
						break;
					default :
						if (tableType == '0') {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&title="
									+ escape(dwmc) + "&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul
									+ "&fenshu=4&urlpara=yes";
							urlAppendix += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&title="
									+ escape(dwmc) + "&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul
									+ "&fenshu=4&urlpara=yes";
						} else {
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&title="
									+ escape(dwmc) + "&tbdw=" + escape(tbdw)
									+ "&bddanjuhao=" + bddanjuhao + "&shul="
									+ shul + "&fenshu=4&urlpara=yes";
							urlAppendix += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
									+ bddanjuhao + "&shul=" + shul + "&tbdw="
									+ escape(tbdw) + "&fenshu=4&urlpara=yes";
						}
						break;
				}
				window
						.open(
								urlMain,
								'newwindow',
								'height=668,width=950,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');

			},
			error : function() {
				alert("未知错误");
			}
		});
		return false;
	});
	/**
	 * 设备处置申请单(管理时)
	 */
	$("a[id^='astChagePrint_']").click(function() {
		var bddanjuhao = $("#chageBillNo").val();
		var applyMethod = $("#applyMethod").val(); // 处置方式
		var tableType = $("#tableType").val(); // 审批单类型
		var urlMain = ""; // 申请单主页面链接URL
		var urlAppendix = ""; // 附件页面连接URL
		$.ajax({
			type : "post",
			url : "/swss/asset/search_findOneDanJuNoAstByExamply.action?type=2&bddanjuhao="
					+ bddanjuhao,
			dataType : "json",
			success : function(res) {
				if (res.count <= 5) {
					switch (applyMethod) {
						case '1' : // 增减值处理
							urlMain += "http://"
									+ printIp
									+ "/"
									+ xnljs[1]
									+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
									+ xnljs[1]
									+ "/ebsys/ebfile/baobiao/sbgl/sbzjzzjd.htm&bddanjuhao="
									+ bddanjuhao + "&dwmc="
									+ escape(zeroDeptName) + "&tbdw="
									+ escape(tbdw) + "&urlpara=yes";
							break;
						case '9' : // 单位内容转移
							if (res.count <= 11) {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/nbzczyd.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&dwmc=" + escape(zeroDeptName)
										+ "&tbdw=" + escape(tbdw)
										+ "&urlpara=yes";
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/nbzczyd_fm.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&dwmc=" + escape(zeroDeptName)
										+ "&tbdw=" + escape(tbdw)
										+ "&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&dwmc=" + escape(zeroDeptName)
										+ "&tbdw=" + escape(tbdw)
										+ "&urlpara=yes";

							}

							break;
						case '7' : // 无偿划拨 注：有偿转让[6]申请单与此一致，必要时可加处理
							if (tableType == '0') {
								if (res.count <= 14) {
									urlMain += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/dbd.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
								} else {
									urlMain += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/dbd_fm.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
									urlAppendix += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
								}
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&tbdw="
										+ escape(tbdw) + "&dwmc="
										+ escape(dwmc) + "&bddanjuhao="
										+ bddanjuhao + "&&drdw=" + escape(drdw)
										+ "shul=" + shul + "&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw) + "&urlpara=yes";
							}
							break;
						case '6' : // 无偿划拨 注：有偿转让[6]申请单与此一致，必要时可加处理
							if (tableType == '0') {
								if (res.count <= 14) {
									urlMain += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/dbd.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
								} else {
									urlMain += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/dbd_fm.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
									urlAppendix += "http://"
											+ printIp
											+ "/"
											+ xnljs[1]
											+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
											+ xnljs[1]
											+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
											+ bddanjuhao + "&shul=" + shul
											+ "&drdw=" + escape(drdw)
											+ "&dwmc=" + escape(dwmc)
											+ "&tbdw=" + escape(tbdw)
											+ "&urlpara=yes";
								}
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&tbdw="
										+ escape(tbdw) + "&dwmc="
										+ escape(dwmc) + "&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw)
										+ "&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&drdw=" + escape(drdw) + "&dwmc="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw) + "&urlpara=yes";
							}
							break;
						default :
							if (tableType == '0') {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcsbspd.htm&title="
										+ escape(dwmc) + "&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&title="
										+ escape(dwmc) + "&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&urlpara=yes";
							} else {
								urlMain += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczsbspd.htm&title="
										+ escape(dwmc) + "&tbdw="
										+ escape(tbdw) + "&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&urlpara=yes";
								urlAppendix += "http://"
										+ printIp
										+ "/"
										+ xnljs[1]
										+ "/ebsys/fceform/ereport/ebrun.htm?file=/"
										+ xnljs[1]
										+ "/ebsys/ebfile/baobiao/sbgl/gyzcczspfj.htm&bddanjuhao="
										+ bddanjuhao + "&shul=" + shul
										+ "&tbdw=" + escape(tbdw)
										+ "&urlpara=yes";
							}
							break;
					}
					window
							.open(
									urlMain,
									'newwindow',
									'height=668,width=950,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');
				} else {
					alert(res.count);
				}
			},
			error : function() {
				alert("未知错误");
			}
		});
		return false;
	});

		// 总账、明细账需要传入的参数
		/*
		 * 制表人 zhibiaoren 制表日期zhibiaoriqi 制表单位zhibiaodanwei 查询起始日期 qsrq 查询截止日期
		 * jzrq 使用单位 sydw 单位名称 title
		 * 
		 */

		// 所有统计表需要传入的参数
		/*
		 * 制表人 zhibiaoren 制表日期zhibiaoriqi 制表单位zhibiaodanwei 查询起始日期 qsrq 查询截止日期
		 * jzrq 使用单位 sydw 单位名称 title 统计级别 tjjb
		 */

		// 所有统计图需要传入的参数
		/*
		 * 制表人 zhibiaoren 制表日期zhibiaoriqi 制表单位zhibiaodanwei 查询起始日期 qsrq 查询截止日期
		 * jzrq 使用单位 sydw 单位名称 title 图形形式 txxs 如：直方图、饼状图等 输出内容 scnr 如：台件、金额等
		 */

});